<template>
  <k-dialog
    width="1130px"
    title="用户日志"
    v-bind="dialogState"
    :show-cancel-btn="false"
    v-on="dialogEvent"
  >
    <k-table v-bind="tableState" v-on="tableEvent">
    </k-table>
  </k-dialog>

</template>

<script setup lang="ts">
import { useLogTableList as useTableList } from '../hooks/use-table';
import { getUserLogs } from '@/api/crm-kgj/user';
import { useDialog } from '@/hooks/use-dialog';

const { tableState, tableEvent, ...tableMethods } = useTableList({
  getList: () => getUserLogs({ id: currentData?.user_id })
});

let currentData: any = null;
const { dialogState, dialogEvent, ...methods } = useDialog({
  onShow: (code, data: any) => {
    currentData = data;
    tableMethods.onSearch();
  }
});

defineExpose({
  show: methods.show
});
</script>
